Solution to Being Unable to Clear Screen
This is usually caused by unsupported terminal. For example, when I log in to the remote server through Ghostty, typing clear or Ctrl - l usually reports an error.
The solution is to set the TERM variable to a terminal that can be recognized. For example, xterm-256color. In fish, we can set
set -gx TERM xterm-256color
In zsh or bash, we can set
export TERM=xterm-256color
And then we can clear and C-l.